import React,{ Component } from 'react'
import { Row } from 'antd'
import { connect } from 'react-redux'
import Crumb from './DiskForm/Crumb'
import DiskNodeSet from './DiskForm/DiskNodeSet'
import Tools from './DiskForm/Tools'

class DiskForm extends Component {
  constructor(props){
    super(props)
    this.selectStack = {
      dirs:Array(0),
      files:Array(0)
    }
    this.state = {
      Refresh:false
    }
  }

  Refresh = () => {
    this.setState({
      Refresh:!this.state.Refresh
    })
  }

  render(){
    return (
      <Row>
      <Crumb _DirStack={this.props._DirStack} dispatch={this.props.dispatch}/>
      <DiskNodeSet
      Refresh={this.Refresh}
      selectStack={this.selectStack}
      />
      <Tools
      stack={this.selectStack}
      />
      </Row>
    )
  }
}

const mapStateToProps = (state) => {
  return {
    disk: state.disk,
    _DirStack: state.disk.DirStack
  }
}

export default connect(mapStateToProps)(DiskForm)
